var _permissionsView;

app.Views.PermissionsView = Backbone.View.extend({
	
	initialize:function () {
		
		_permissionsView = this;
		
		this.template = _.template(tpl.get('permissions'));
		this.delegateEvents();   
		
        return this;	
    },	

    render:function (eventName) {		
		
		$(this.el).html(this.template());
		
		var permissions = _.pairs(this.model.attributes);
		
		_.each(permissions, function (data) { $(_permissionsView.el).find("#perm").append("<li><strong>"+data[0]+"</strong> : "+data[1]+"</li>"); });
		   
        return this;
    },	
	
	destroy:function(){
	
		$(this.el).empty();
		
	}

});